 <%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    <%
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ request.getContextPath()+"/";
%>
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <link rel="stylesheet" href="<%=basePath %>css/updateVideo.css">
		<link href="<%=basePath %>css/H-ui.min.css" rel="stylesheet" type="text/css" />
		<link rel="stylesheet" href="<%=basePath %>lib/icheck/icheck.css">
		<link rel="stylesheet" href="<%=basePath %>css/list.css">
		<script src="<%=basePath %>js/jquery.min.js"></script>
		<script src="<%=basePath %>js/jquery.cookie.js"></script>
        <script src="<%=basePath %>lib/My97DatePicker/WdatePicker.js"></script>
        <script src="<%=basePath %>lib/icheck/jquery.icheck.min.js"></script>
        <script src="<%=basePath %>lib/bootstrap-modal/2.2.4/bootstrap-modalmanager.js"></script>
        <script src="<%=basePath %>lib/bootstrap-modal/2.2.4/bootstrap-modal.js"></script>
		<script src="<%=basePath %>js/H-ui.js"></script>
         <script>
	        $(function() {
	        	var source=$("#source").val();
	        	if(source==2){
	        		$("#orderRemarkids").hide();
	        	}
  		    	$(".hoverShowThisImg").click(function(){
  	    			var src = $(this).attr("id");
  	    			$("#showImg").attr("src","${WF_CONSOLE_CONFIG_OSS_URL}"+src);
  	    			$("#clickShowModal").click();  
  	    		});
	        });
	        function uqdateOrderRemarks(){
	        	$("#orderRemarkid").show();
	        	
	        	
	        }
	        function uqdatenewOrderRemark(){
	           	var  uqdateremark = $("#updateRemark").val();
	           	var orderCode = $("#goodsOrders").val();
	        	var params = "uqdateremark="+uqdateremark+"&orderCode="+orderCode;
	        	var url = "<%=basePath %>goodsOrder/updateOrderRemark?"+params ;
	        	window.location.href = url;
	        	
	        }
	        function returnlist(){
	        	var source=$("#source").val();
	        	var orderRemarks=$("#orderRemarks").val();
	        	if(source==1){
	             if(orderRemarks==null || orderRemarks==""){
	            	 window.history.go(-1); 
	            	 
	             }else{
	        		var url = "<%=basePath %>goodsOrder/goodsOrderList";
		        	window.location.href = url;
	             }
	        	}else{
	        		window.history.go(-1);	
	        		
	        	}
	        	
	        }
        </script>
    </head>
    <body>
    	 	<div class="connect_wrap">
    	
    	 <div class="col-sm-5">
			<input type="button"  class="btn btn-primary" value="返回" onclick="returnlist()" style="float: right;">
		</div>
    	<br/>
    	
    		<div class="row cl">
				<div class="col-sm-8 col-push-2">
					<div class="panel panel-default">
						<div class="panel-header">
							订单信息
						</div>
						<input type="hidden" id="goodsOrders" value="${goodsOrder.orderCode}" />
						<input type="hidden" id="source" value="${source}" />
						<input type="hidden" id="orderRemarks" value="${goodsOrder.orderRemark}"/>
						<div class="panel-body">
							<ul>
							 <li>订单编号: ${goodsOrder.orderCode}</li>
							  <li>订单支付方式 : 
							  	<c:if test="${goodsOrder.payType eq '1'}">微信支付 </c:if>
							  </li>
							 <li>支付单号: ${goodsOrder.transaction_id}</li>
							  <li >订单状态： 
							    <c:if test="${goodsOrder.orderStatus eq '1'}">待付款</c:if>
				                <c:if test="${goodsOrder.orderStatus eq '2'}">待收货</c:if>
				                <c:if test="${goodsOrder.orderStatus eq '3'}">待评价</c:if>
				                <c:if test="${goodsOrder.orderStatus eq '4'}">已完成</c:if>
				                <c:if test="${goodsOrder.orderStatus eq '5'}">取消订单</c:if>
				                <c:if test="${goodsOrder.orderStatus eq '6'}"><font style="color:red;">已退货</font></c:if>
							  </li>
							  <li>下单时间: ${goodsOrder.orderTime}</li>
							  <li>订单支付时间: ${goodsOrder.orderPayTime}</li>
							  <li >订单来源渠道: ${goodsOrder.userSource}</li>
							  <li >手机号: ${goodsOrder.telephone}</li>
							  <li >购买课程: ${goodsNames}</li>
							  <li >订单总金额: ${goodsOrder.goodsAmount}</li>
							   <li>全场活动：${goodsOrder.activityInfo }</li>
							  <li >原铜钱消耗: ${goodsOrder.oldCopperCash}</li>
							  <li >新铜钱消耗: ${goodsOrder.newCopperCash}</li>
							  <li >使用金币: ${goodsOrder.gold}</li>
							  <li >新金币: ${goodsOrder.newGold}</li>
							  <li >使用优惠券: ${goodsOrder.title}</li>
							   <li >实际支付: ${goodsOrder.orderAmount}
							  <%--  <c:if test="${goodsOrder.realPay.indexOf('-')<0}"> ${goodsOrder.realPay}</c:if>
							   <c:if test="${goodsOrder.realPay.indexOf('-')>=0}">0.00</c:if> --%>
							   </li>
							 <%--  <li >实际支付: ${goodsOrder.realPay}</li> --%>
							 
							  <li >配置说明: ${goodsOrder.remark}</li>
							  <li >订单备注: ${goodsOrder.orderRemark}<div id="orderRemarkids"><button type="button" onclick="uqdateOrderRemarks();">修改订单备注信息</button></div></li>
							   <li ><div id="orderRemarkid" style="width:400px;display:none;margin-top: 20px;"><input type="text" id="updateRemark" style="border: 1px solid;border-radius: 5px" /><p style="text-align: center;margin-left: -65%"><button type="button" onclick="uqdatenewOrderRemark();">保存</button></p></div></li>
							</ul>  
						</div>
					</div>
				</div>
			</div>
			<%-- <br/>
			<br/>
			<div class="row cl">
				<div class="col-sm-8 col-push-2">
					<div class="panel panel-default">
						<div class="panel-header">收件人信息</div>
						<div class="panel-body">
							<ul>
							  <li>收件人: ${goodsOrder.recipient}</li>
							  <li>收件人电话:${goodsOrder.recipientPhone}</li>
							  <li>收件人省市区 : ${goodsOrder.recipientPcd}</li>
							  <li>收件地址 : ${goodsOrder.recipientAddress}</li>
							  <li>邮政编码 : ${goodsOrder.postCode}</li>
							</ul>
						</div>
					</div>
				</div>
			</div> --%>
			
			
			
			<br/>
			<br/>
			
				<div class="col-sm-8 col-push-2">
			<table class="table table-border table-bordered table-striped table-hover">
    		<tr style="font-weight: bold;">
    			<td>序号</td>
    			<td>商品ID</td>
    			<td>商品名称</td>
    			<td>商品数量</td>  
    			<td>商品价格</td>
    			<td>商品类型</td>  
    			<td>全场活动</td> 
    			<td>优惠券</td> 
    			<td>原铜钱消耗</td> 
    			<td>新铜钱消耗 </td> 
    			<td>金币</td> 
    			<td>新金币</td>
    			<td>实际支付</td>
    			<td>授课老师</td> 
    			<td>误差数值</td> 
    			<td>是否退货</td>
    		</tr>
    		
    		<c:if test="${not empty page.results}">
    			<c:forEach items="${page.results}" var="result" varStatus="vs">
    			<tr>
    				<td >${(page.actulPageNo -1)*15+vs.count}</td>
	                <td>${result.goodsId}</td>
	                <td>${result.goodsName}</td>
	               	<td >${result.goodsCount}</td>
	                <td>${result.goodsPrice}</td>
	                <td>
						<c:if test="${result.goodsSort eq '1'}">课程</c:if>
                		<c:if test="${result.goodsSort eq '2'}">章节</c:if>
               			<c:if test="${result.goodsSort eq '3'}">VIP卡</c:if>
              			<c:if test="${result.goodsSort eq '4'}">商品</c:if>
					</td>
					 <td>${result.activityCash}</td>
					 <td>${result.couponsCash}</td> 
					 <td>${result.oldCopperCash}</td>
					 <td>${result.newCopperCash}</td>
					 <td>${result.gold}</td>
					 <td>${result.newGold}</td>
					  <td>${result.realPay}</td>
					 <td>${result.speakerName}</td>
					 <td>
					     ${result.errorvalue}
					 </td>
	                <td>
	                	<c:if test="${result.backFlag eq 0}">未退货</c:if>
						<c:if test="${result.backFlag eq 1}">已退货</c:if>
	                </td>
	                <%-- <td>${result.specification}</td> --%>
	    		</tr>
    		</c:forEach>
    	</c:if>
		</table>		
						
				</div>
			
     	</div>
    	
    	<!-- 弹出图片 -->
    	<a data-toggle="modal" href="#myModal" id="clickShowModal" class="btn btn-primary size-L" style="display:none">点击显示</a>
		<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
		   <div class="modal-body">
				<img src="" alt="" id="showImg" style="width:100%;height:90%;" />		     	
		   </div>
		</div>    
    	
        <!-- 分页 -->
    	 <div>
	 	 
     </div>
    
   	</body>
</html>


 